package com.guoxin.designpattern.chapter8;

/**
 * @author guoxin
 * @date 2019/9/5
 */
public class SyncInvoker {
    public static void main(String[] args) throws InterruptedException {
        FutureService futureService = new FutureService();
        Future<String> future = futureService.submit(() -> {
            try {
                Thread.sleep(10000L);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            return "FINISH";
        });

        String result = future.get();
        System.out.println(result);

    }
}
